<template>
    <div class="wrapper" ref="wrapper">
      <div class="content">
        <slot></slot>
      </div>
    </div>
</template>

<script>
    import BSscroll from 'better-scroll'
    export default {
        name: "Scroll",
        data() {
          return {
            scroll:null
          }
        },
        props: {
          probeType:{
            type: Number,
            default: 0
          },
          pullUpLoad: {
            type:Boolean,
            default: false
          }
        },

        mounted() {
          this.scroll = new BSscroll(this.$refs.wrapper,{
              observeDOM:true,
              click:true,
              probeType:this.probeType,
              pullUpLoad:this.pullUpLoad


          })

          this.scroll.on('scroll',(position) => {
            // console.log(position);
            this.$emit('scroll',position)
          })

          this.scroll.on('pullingUp',() => {
            this.$emit('pullingUp')}
            )

            // console.log('拉');
        },
      methods: {
        finishPullUp(){
            this.scroll.finishPullUp()
          }
      }
    }
</script>

<style scoped>

</style>
